// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.
//
// ███╗   ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
// ████╗  ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
// ██╔██╗ ██║██║   ██║   ██║   ██║██║     █████╗
// ██║╚██╗██║██║   ██║   ██║   ██║██║     ██╔══╝
// ██║ ╚████║╚██████╔╝   ██║   ██║╚██████╗███████╗
// ╚═╝  ╚═══╝ ╚═════╝    ╚═╝   ╚═╝ ╚═════╝╚══════╝
// ------------------------------------------------
//
// This file is automatically generated.
// Please do not edit these files manually.
//
// ------------------------------------------------

#nullable restore

using System;
using System.Linq;
using Elastic.Clients.Elasticsearch.Serialization;

namespace Elastic.Clients.Elasticsearch.MachineLearning;

[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.MachineLearning.Json.CategorizationAnalyzerConverter))]
public sealed partial class CategorizationAnalyzer : Elastic.Clients.Elasticsearch.Union<string, Elastic.Clients.Elasticsearch.MachineLearning.CategorizationAnalyzerDefinition>
{
	public CategorizationAnalyzer(string value) : base(value)
	{
	}

	public CategorizationAnalyzer(Elastic.Clients.Elasticsearch.MachineLearning.CategorizationAnalyzerDefinition value) : base(value)
	{
	}

	public static implicit operator Elastic.Clients.Elasticsearch.MachineLearning.CategorizationAnalyzer(string value) => new Elastic.Clients.Elasticsearch.MachineLearning.CategorizationAnalyzer(value);
	public static implicit operator Elastic.Clients.Elasticsearch.MachineLearning.CategorizationAnalyzer(Elastic.Clients.Elasticsearch.MachineLearning.CategorizationAnalyzerDefinition value) => new Elastic.Clients.Elasticsearch.MachineLearning.CategorizationAnalyzer(value);
}

public readonly partial struct CategorizationAnalyzerFactory
{
	public Elastic.Clients.Elasticsearch.MachineLearning.CategorizationAnalyzer Name(string value)
	{
		return new Elastic.Clients.Elasticsearch.MachineLearning.CategorizationAnalyzer(value);
	}

	public Elastic.Clients.Elasticsearch.MachineLearning.CategorizationAnalyzer Definition(Elastic.Clients.Elasticsearch.MachineLearning.CategorizationAnalyzerDefinition value)
	{
		return new Elastic.Clients.Elasticsearch.MachineLearning.CategorizationAnalyzer(value);
	}

	public Elastic.Clients.Elasticsearch.MachineLearning.CategorizationAnalyzer Definition()
	{
		return new Elastic.Clients.Elasticsearch.MachineLearning.CategorizationAnalyzer(Elastic.Clients.Elasticsearch.MachineLearning.CategorizationAnalyzerDefinitionDescriptor.Build(null));
	}

	public Elastic.Clients.Elasticsearch.MachineLearning.CategorizationAnalyzer Definition(System.Action<Elastic.Clients.Elasticsearch.MachineLearning.CategorizationAnalyzerDefinitionDescriptor>? action)
	{
		return new Elastic.Clients.Elasticsearch.MachineLearning.CategorizationAnalyzer(Elastic.Clients.Elasticsearch.MachineLearning.CategorizationAnalyzerDefinitionDescriptor.Build(action));
	}

	[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
	internal static Elastic.Clients.Elasticsearch.MachineLearning.CategorizationAnalyzer Build(System.Func<Elastic.Clients.Elasticsearch.MachineLearning.CategorizationAnalyzerFactory, Elastic.Clients.Elasticsearch.MachineLearning.CategorizationAnalyzer> action)
	{
		var builder = new Elastic.Clients.Elasticsearch.MachineLearning.CategorizationAnalyzerFactory();
		return action.Invoke(builder);
	}
}